import { createRouter, createWebHashHistory } from 'vue-router'

export default createRouter({
  history: createWebHashHistory(),
  routes: [
    { 
      path: '/', 
      component: () => import('@/layout/index.vue'),
      redirect: '/index',
      children: [
        { path: 'index', component: () => import('@/views/Example/index.vue') },
        { path: 'example', component: () => import('@/views/Example/example.vue') },
        { path: 'icons', component: () => import('@/views/Example/Icons.vue') },
        { path: 'utils/array', component: () => import('@/views/Example/Utils/ArrayUtil.vue') },
        { path: 'utils/date', component: () => import('@/views/Example/Utils/DateUtil.vue') },
        { path: 'utils/request', component: () => import('@/views/Example/Utils/HttpRequest.vue') },
        { path: 'utils/common', component: () => import('@/views/Example/Utils/CommonUtil.vue') },
        { path: 'directive/drag', component: () => import('@/views/Example/Directive/Draggable.vue') },
        { path: 'directive/loding', component: () => import('@/views/Example/Directive/Loding.vue') },
        { path: 'directive/tabChange', component: () => import('@/views/Example/Directive/TabChange.vue') },
        { path: 'charts/pie', component: () => import('@/views/Example/Charts/PieChart.vue') },
        { path: 'charts/line', component: () => import('@/views/Example/Charts/LineChart.vue') },
        { path: 'charts/bar', component: () => import('@/views/Example/Charts/BarChart.vue') },
      ] 
    },
    { path: '/about', component: () => import('@/views/Example/About.vue') },
    { path: '/form/generator', component: () => import('@/views/Example/Form/generator.vue') },
    { path: '/form/parse', component: () => import('@/views/Example/Form/parse.vue') },
  ]
})